package com.foreknow.demo3;

import java.util.Scanner;

public class Demo {
    public static void main(String[] args) {
//        int score = 14;
//        String gender = "男";
//        if(score <= 12) {
//            if(gender.equals("男")) { //字符串之间比较等价使用equals
//                System.out.println("进入男子组......");
//            }else if(gender.equals("女")) {
//                System.out.println("进入女子组......");
//            }
//        }else {
//            System.out.println("淘汰......");
//        }
        Scanner input = new Scanner(System.in);
        System.out.println("是否是会员(y/n)");
        String isRight = input.next();
        System.out.println("请输入购物的金额:");
        double money = input.nextDouble();
        if(isRight.equals("y")) { //会员
            if(money > 2000) {
                money = money * 0.75;
            }else {
                money = money * 0.8;
            }
        }else { //非会员
            if(money > 100) {
                money = money * 0.9;
            }
        }
        System.out.println("实际支付: " + money);
    }
}
